import { PureComponent } from 'react';
import {
	Row,
	Col,
	Form,
	Input,
	Select,
	Modal,
	DatePicker,
	Button,
	message
} from 'antd';
import styles from './ProUserList.less';
import policeApplication from '@/assets/police_application.png';
import policeApplication2 from '@/assets/police_application2.png';
import MemberShipModal from './MemberShipModal';//生成花名册
const FormItem = Form.Item;
const { Option } = Select;
const { TextArea } = Input;

@Form.create()
class ApplicationModal extends PureComponent {

	constructor(props) {
	    super(props);
	    this.state = {
			modalVisibleByMembership: false
	    }
	}


	//生成花名册
	handleModalVisibleByMembership = flag => {
		const {
			handleModalVisibleByApplication,
		} = this.props;
		handleModalVisibleByApplication();
		this.setState({
			modalVisibleByMembership: !!flag,
		});
		if(flag) {
			message.success('生成成功');
		}
	};

	handleAddByMembership = () => {
		const { dispatch } = this.props;

		this.handleModalVisibleByMembership();

	};

  render() {
  		const {
			modalVisibleByApplication,
			form,
			handleModalVisibleByApplication,
		} = this.props;

		const { modalVisibleByMembership } = this.state;
		//生成花名册
		const parentMethodsByMembership = {
			handleModalVisibleByMembership: this.handleModalVisibleByMembership,
			handleAddByMembership: this.handleAddByMembership,
			modalVisibleByMembership
		};
return (
<div>
<Modal
width={1000}
centered
destroyOnClose
title="请示文件"
visible={modalVisibleByApplication}
onCancel={() => handleModalVisibleByApplication()}
footer={<Button onClick={() => handleModalVisibleByApplication()}>取消</Button>}
>
<div style={{width: '100%',height: '530px',overflow: 'auto',textAlign: 'center',position: 'relative'}}>
	        {/*<Button type="primary" className={styles.createMembership} onClick={() => this.handleModalVisibleByMembership(true)}>
    		生成花名册
    		</Button>*/}
	<img alt="" src={policeApplication} style={{width: '80%'}}/>
	<img alt="" src={policeApplication2} style={{width: '80%'}}/>
</div>
</Modal>
	<MemberShipModal {...parentMethodsByMembership}/>
</div>

);
  }

}

export default ApplicationModal;
